package arrayList_basics.src.Polymorphic;

public class Test {
    public static void main(String[] args) {
        Student s = new Student("张三",17);
        Tercher t = new Tercher("李四",27);
        s.setName("zhangSan");
        register(s);
        register(t);
//        调用成员变量编译看左边,运行结果也看左边
        Person s2 = new Student("张三",17);
        System.out.println(s.gender);
        System.out.println(s2.gender);
//        调用成员方法编译看左边,运行结果看右边
        s.getIngo();
        s2.getIngo();
    }
    public static void register(Person p){
        p.getIngo();
    }
}
